<template>
  <div class="detail-bottombar">
    <div class="bar-left">
      <div class="left-item">
        <i></i>
        <span>客服</span>
      </div>
      <div class="left-item">
        <i></i>
        <span>店铺</span>
      </div>
      <div class="left-item">
        <i></i>
        <span>收藏</span>
      </div>
    </div>

    <div class="bar-right">
      <div class="right-item" @click="addClick">
        <span>加入购物车</span>
      </div>
      <div class="right-item">
        <span>购买</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailBottomBar',
  methods: {
    addClick() { // 添加购物车功能
      this.$emit('addClick');
    }
  }
}
</script>

<style scoped>
  .detail-bottombar{
    height: 49px;
    background-color: #fff;
    width: 100%;
    display: flex;
  }

  /* 左边 */
  .bar-left{
    flex: 1;

    display: flex;
  }
  .left-item{
    flex: 1;
    text-align: center;
    font-size: 14px;
  }
  .left-item i{
    margin: 0 auto;
    display: block;
    width: 25px;
    height: 25px;
    background-image: url('~assets/img/detail/detail_bottom.png');
    background-repeat: no-repeat;
    background-size: 25px auto;
    background-position: 0 -60px;
    margin-top: 3px;
  }
  .left-item:nth-of-type(2) i{
    background-position: 0 0px;
  }
  .left-item:nth-of-type(3) i{
    background-position: 0 -110px;
  }
  .left-item span{
    display: block;
    margin-top: 4px;
  }

  /* 右边 */
  .bar-right{
    flex: 1;

    display: flex;
    text-align: center;

  }
  .right-item{
    flex: 1;
    line-height: 49px;
    font-size: 16px;
  }
  .right-item:nth-of-type(1){
    color: black;
    background-color: rgba(247, 214, 15, 1);
  }
  .right-item:nth-last-of-type(1){
    background-color: var(--color-tint);
    color: white;
    font-weight: bold;
  }
</style>